#ifndef __DEBUG__
// For printing purposes
#define __DEBUG__ 0
#endif

#include <iostream>
#include <cstdint>

#include "../VAR.hpp"
#include "../TERM.hpp"
#include "../EXPRESSION.hpp"
#include "../ADD.hpp"
#include "../SUB.hpp"
#include "../MIN.hpp"
#include "../MAX.hpp"
#include "../CEIL.hpp"
#include "../FLOOR.hpp"

#include "../GE.hpp"

using namespace std;

void test7() {
  constexpr VariableTerm<1> t1;
  constexpr VariableTerm<2> t2;
  constexpr VariableTerm<3> t3;
  constexpr VariableTerm<4> t4;
  constexpr VariableTerm<5> t5;
  constexpr VariableTerm<6> pN;
  constexpr VariableTerm<7> pT;
  
  constexpr std::tuple<int, int, int, int, int, int, int, int> 
    test_tuple_min(0, 1, 2, 3, 4, 5, 256, 2048);
  constexpr std::tuple<int, int, int, int, int, int, int, int> 
    test_tuple_max(0, 10, 20, 30, 40, 50, 256, 2048);
  {  
    auto exprlb = max(max(0,ceil(t1+t2-1,2)),ceil(16*t2-pN-14,16));
    auto exprub = min(min(floor(pT+pN-2,16),floor(16*t2+pN+14,16)),floor(8*t1+8*t2+pN+15,16));
    
    auto exprcmp = (exprub >= exprlb);
    if (__DEBUG__) cout << endl << "\tEXPRCMP evals to " << endl <<  exprcmp << endl;
  }

  {
    auto exprlb = max(max(0,ceil(t1+t2-1,2)),ceil(16*t2-pN-14,16));
    auto exprub = 2;
    
    auto exprcmp = (exprub >= exprlb);
    if (__DEBUG__) cout << endl << "\tEXPRCMP evals to " << endl <<  exprcmp << endl;
  }

}

int main (void) {
  test7();
}
